package com.chenzehe.zdmya.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.chenzehe.zdmya.dao.CategoryDao;
import com.chenzehe.zdmya.domain.Category;

@Service
@Transactional
public class CategoryService extends BaseService implements ICategoryService {
	@Resource
	CategoryDao categoryDao;

	@Override
	public Category getByename(String ename) {
		return categoryDao.findUniqueBy("ename", ename);
	}

	@Override
	public List<Category> queryByParentId(int parentId) {
		return categoryDao.findBy("parentId", parentId);
	}
}
